package cn.edu.zafu.bigdata.x.zyy;

// MathOperations.java
class MathOperations {
    // 返回两个整数的和
    public int add(int a, int b) {
        return a + b;
    }

    // 返回两个浮点数的和
    public double add(double a, double b) {
        return a + b;
    }

    // 返回三个整数的和
    public int add(int a, int b, int c) {
        return a + b + c;
    }
}

// TestMathOperations.java
public class TestMathOperations {
    public static void main(String[] args) {
        MathOperations mathOps = new MathOperations();

        // 测试整数加法
        int sumInt = mathOps.add(5, 3);
        System.out.println("整数和: " + sumInt);

        // 测试浮点数加法
        double sumDouble = mathOps.add(5.5, 3.3);
        System.out.println("浮点数和: " + sumDouble);

        // 测试三个整数的加法
        int sumInts = mathOps.add(5, 3, 2);
        System.out.println("三个整数的和: " + sumInts);
    }
}